Skip to content

Add DGP Cookie Consent#6

Open
danielsitek wants to merge 9 commits intoconsentdotio:mainfrom
danielsitek:feature/ds-add-dgp-cookie-consent
Open

Add DGP Cookie Consent#6
danielsitek wants to merge 9 commits intoconsentdotio:mainfrom
danielsitek:feature/ds-add-dgp-cookie-consent

Conversation

@danielsitek
Copy link
Copy Markdown

@danielsitek danielsitek commented Nov 7, 2025

Add DGP Cookie Consent to benchmarks

This PR adds DGP Cookie Consent to the cookie consent benchmarks suite.

Key Features

  • Native Web Components: Built using standard web components with Shadow DOM encapsulation
  • Zero Dependencies: Lightweight implementation without external framework dependencies
  • TypeScript: Fully typed implementation with TypeScript support
  • MIT Licensed: Open source solution with permissive licensing

Why This Addition Matters

This benchmark provides valuable insights into the performance characteristics of a web component-based cookie consent solution compared to traditional JavaScript/React implementations. It's particularly interesting for:

  • Measuring the impact of Shadow DOM on performance metrics
  • Comparing native web standards vs. framework-based approaches
  • Evaluating the bundle size and loading performance of zero-dependency solutions

Implementation Details

  • Uses <consent-dialog> custom element with Shadow DOM
  • Configurable translations and settings via global objects
  • Loaded from JSDelivr CDN (1.8.0)
  • Supports GDPR compliance with granular cookie categories

Summary by CodeRabbit

  • New Features
    • Added a new benchmark app that includes a cookie consent UI preloaded on page load, localized UI text, and a simple test page showing "Benchmark".
    • Includes benchmark configuration for measurement and visibility of the cookie banner.
  • Chores
    • Project setup files (package, TS & Next config) added to enable build, dev and tooling.

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 7, 2025

@danielsitek is attempting to deploy a commit to the Consent Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 7, 2025

Walkthrough

A new benchmark project is added at benchmarks/with-dgp-cookie-consent/ with a Next.js 16 app: a RootLayout that injects inline cookie-consent configuration and loads the dgp-cookie-consent script from a CDN, plus a simple page, project config, and TypeScript/Next config files.

Changes

Cohort / File(s) Summary
App layout & page
benchmarks/with-dgp-cookie-consent/app/layout.tsx, benchmarks/with-dgp-cookie-consent/app/page.tsx
Adds metadata export and default RootLayout that renders an HTML shell (lang="en", suppressHydrationWarning). Layout injects an inline style forcing consent-dialog display, an inline config script (id="dgp-cookie-consent-config") setting window.CookieConsentTranslations and window.CookieConsentSettings, and an external CDN script (id="dgp-cookie-consent-script") loaded with beforeInteractive/async. Adds Home page rendering an <h1>Benchmark</h1>.
Next & TypeScript config
benchmarks/with-dgp-cookie-consent/next.config.ts, benchmarks/with-dgp-cookie-consent/tsconfig.json, benchmarks/with-dgp-cookie-consent/next-env.d.ts
Adds next.config.ts exporting nextConfig: NextConfig. Adds tsconfig.json extending shared config, sets baseUrl and "@/*" path alias, includes/excludes. Adds next-env.d.ts with Next.js and Next/Image references and header comments.
Project manifest & benchmark config
benchmarks/with-dgp-cookie-consent/package.json, benchmarks/with-dgp-cookie-consent/config.json
Adds package.json (private) with scripts: benchmark, build, dev, format, lint, start; dependencies include Next.js 16.0.1, React 19.2.0, and workspace devDeps. Adds config.json describing benchmark metadata, iterations, cookieBanner detection/measurement options, tech stack, i18n, source metadata, tags, and service hosts.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Browser
  participant RootLayout
  participant CDN as dgp-cookie-consent CDN
  participant CookieUI as CookieConsent UI

  Note over RootLayout,Browser: Page render includes inline config script + CDN script (beforeInteractive)
  RootLayout->>Browser: Serve HTML with inline config (window.CookieConsentTranslations/Settings)
  Browser->>CDN: Load external dgp-cookie-consent script (async, beforeInteractive)
  CDN-->>Browser: Script executed
  Browser->>CookieUI: Initialize using window.CookieConsentSettings/Translations
  CookieUI-->>Browser: Render consent dialog (forced visible by inline style)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review focus:
    • app/layout.tsx: verify inline script contents, correct global names (window.CookieConsentTranslations, window.CookieConsentSettings), script attributes (id, async, beforeInteractive) and the inline style that forces visibility.
    • config.json: ensure benchmark fields (iterations, detection settings, hosts, tags) match conventions and measurement needs.
    • package.json: confirm dependency versions and workspace devDependencies are intentional.

Poem

🐰 In a warren of code I hop and prance,
a cookie dialog gets its chance,
configs whispered on the window sill,
CDN winds bring the consentful thrill,
benchmarks hum — a crunchy dance.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add DGP Cookie Consent' clearly and concisely summarizes the main change: adding a new DGP Cookie Consent benchmark to the repository.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 11de63e and cbd05ea.

📒 Files selected for processing (1)
  • benchmarks/with-dgp-cookie-consent/next-env.d.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ab0a042 and 11de63e.

⛔ Files ignored due to path filters (2)
  • benchmarks/with-dgp-cookie-consent/app/favicon.ico is excluded by !**/*.ico
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • benchmarks/with-dgp-cookie-consent/app/layout.tsx (1 hunks)
  • benchmarks/with-dgp-cookie-consent/app/page.tsx (1 hunks)
  • benchmarks/with-dgp-cookie-consent/config.json (1 hunks)
  • benchmarks/with-dgp-cookie-consent/next-env.d.ts (1 hunks)
  • benchmarks/with-dgp-cookie-consent/next.config.ts (1 hunks)
  • benchmarks/with-dgp-cookie-consent/package.json (1 hunks)
  • benchmarks/with-dgp-cookie-consent/tsconfig.json (1 hunks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant